package com.ruoyi.hospital.service.order.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.order.ShopAfterAddressMapper;
import com.ruoyi.hospital.domain.order.ShopAfterAddress;
import com.ruoyi.hospital.service.order.IShopAfterAddressService;

/**
 * 回寄地址Service业务层处理
 * 
 * @author wendao
 * @date 2024-09-30
 */
@Service
public class ShopAfterAddressServiceImpl implements IShopAfterAddressService 
{
    @Autowired
    private ShopAfterAddressMapper shopAfterAddressMapper;

    /**
     * 查询回寄地址
     * 
     * @param id 回寄地址主键
     * @return 回寄地址
     */
    @Override
    public ShopAfterAddress selectShopAfterAddressById(Integer id)
    {
        return shopAfterAddressMapper.selectShopAfterAddressById(id);
    }

    @Override
    public ShopAfterAddress selectShopAfterAddressByStoreId(Integer storeId) {
        return shopAfterAddressMapper.selectShopAfterAddressByStoreId(storeId);
    }

    /**
     * 查询回寄地址列表
     * 
     * @param shopAfterAddress 回寄地址
     * @return 回寄地址
     */
    @Override
    public List<ShopAfterAddress> selectShopAfterAddressList(ShopAfterAddress shopAfterAddress)
    {
        return shopAfterAddressMapper.selectShopAfterAddressList(shopAfterAddress);
    }

    /**
     * 新增回寄地址
     * 
     * @param shopAfterAddress 回寄地址
     * @return 结果
     */
    @Override
    public int insertShopAfterAddress(ShopAfterAddress shopAfterAddress)
    {
        shopAfterAddress.setCreateTime(DateUtils.getNowTimeSecond());
        return shopAfterAddressMapper.insertShopAfterAddress(shopAfterAddress);
    }

    /**
     * 修改回寄地址
     * 
     * @param shopAfterAddress 回寄地址
     * @return 结果
     */
    @Override
    public int updateShopAfterAddress(ShopAfterAddress shopAfterAddress)
    {
        shopAfterAddress.setUpdateTime(DateUtils.getNowTimeSecond());
        return shopAfterAddressMapper.updateShopAfterAddress(shopAfterAddress);
    }

    /**
     * 批量删除回寄地址
     * 
     * @param ids 需要删除的回寄地址主键
     * @return 结果
     */
    @Override
    public int deleteShopAfterAddressByIds(Integer[] ids)
    {
        return shopAfterAddressMapper.deleteShopAfterAddressByIds(ids);
    }

    /**
     * 删除回寄地址信息
     * 
     * @param id 回寄地址主键
     * @return 结果
     */
    @Override
    public int deleteShopAfterAddressById(Integer id)
    {
        return shopAfterAddressMapper.deleteShopAfterAddressById(id);
    }
}
